<template>
	<view class="container pl30 pr30">
		<worker v-for="item in data" :data="item" :key="item.id" @click="choose"></worker>
		<empty msg="同城暂无可选师傅" v-if="data.length === 0"></empty>
	</view>
</template>

<script setup lang="ts">
	import { onLoad,onPullDownRefresh,onReachBottom } from "@dcloudio/uni-app"
	import { routeFn, usePaging } from "../../lib/ts/util";
	import { useStore } from "../../store";
	import { reactive } from "vue";
	
	
	const store = useStore()
	
	
	onLoad((options)=>{
		form.car_type_dl_id = options.car_type_dl_id
		form.car_type_id = options.car_type_id
		reload({area_id:store.area_id,...form})
	})
	onPullDownRefresh(()=>{
		reload({area_id:store.area_id,...form})
	})
	onReachBottom(()=>{
		getMore({area_id:store.area_id,...form})
	})
	
	
	const {
		data,
		reload,
		getMore
	} = usePaging('/api/order_info/UseSf')
	
	let form = reactive({
		car_type_id:'1',
		car_type_dl_id:'1'
	})
	
	const choose = (e)=>{
		uni.navigateBack({
			success() {
				uni.$emit('chooseWorker',e)
			}
		})
	}
	

</script>

<style scoped lang="scss">
	
	
	
	
	
</style>
